﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WisDom.SmartTMS.Entity;

namespace WisDom.SmartTMS.Validator
{
    /// <summary>
    /// 人事入职的验证器
    /// </summary>
    public class PersonnelEntryValidator : IEntityTypeConfiguration<PersonnelEntry>
    {
        public void Configure(EntityTypeBuilder<PersonnelEntry> builder)
        {
            builder.ToTable("PersonnelEntry");
            builder.Property("EntryName").HasMaxLength(50).IsRequired();
            builder.Property("DepId").HasMaxLength(50).IsRequired();
            builder.Property("Position").HasMaxLength(50).IsRequired();
            builder.Property<int>("ApprovalSeate").HasColumnType("int").IsRequired();
            builder.Property("Principal").HasMaxLength(50).IsRequired();
            builder.Property("Approver").HasMaxLength(50).IsRequired();
            builder.Property("ComeTimes").HasColumnType("date").IsRequired();
            builder.Property("CreateTimes").HasColumnType("date").IsRequired();
            builder.Property("ContracTimes").HasColumnType("date").IsRequired();
        }
    }
}
